<?php
require_once('../../conf/config.php.inc');
require_once(SYBMAS_LIB_PATH.'/liblogin.php.inc');
require_once(SYBMAS_LAYOUT_PATH.'/layout.php.inc');
require_once(SYBMAS_LIB_PATH.'/libsybmas.php.inc');
require_once(SYBMAS_LAYOUT_PATH.'/menu.php.inc');
require_once('libtablas.php.inc');
verificar_inicio_sesion();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css"
	href="<?php echo LAYOUT_URI?>/sybmasstyle.css">
<script src="<?php echo LAYOUT_URI?>/jquery-1.2.1.min.js"
	type="text/javascript"></script>
<script src="<?php echo LAYOUT_URI?>/menu-collapsed.js"
	type="text/javascript"></script>
<link rel="stylesheet" type="text/css"
	href="<?php echo LAYOUT_URI?>/style.css" >
<link rel="stylesheet" type="text/css"
	href="<?php echo JAVASCRIPT_URI?>/tabs/tabs.css">
<script src="<?php echo JAVASCRIPT_URI?>/tabs/tabs.js"
	type="text/javascript"></script>
<script type="text/javascript" src="<?php echo JAVASCRIPT_URI?>/commons.js"></script>
<title>.:: Sybmas - Modificar Fullname</title>
<!--[if lt IE 8]>
   <style type="text/css">
   li a {display:inline-block;}
   li a {display:block;}
   </style>
   <![endif]-->
</head>
<body onunload="closeDialog()">
<script src="<?php echo JAVASCRIPT_URI?>/tooltip/wz_tooltip.js"
	type="text/javascript"></script>
<div id="dialog">
<div class="title">Cambiar Password</div>
<?php 
$passAct = $_POST['passActual'];
$passNuevo = $_POST['passNuevo'];
$passlogin = $_POST['passlogin'];
?>
<?php
	$validacionPassword=$_SESSION['sybmas.user.password']==$passAct;
		
	if(!$validacionPassword){
		echo "<h1>Su password es incorrecto, favor de verificar</h1>";
	}else{
		$sybuser_connection=start_default_sybuser_connection();
		$passAct=$passAct==''?'null':$passAct;
		$query="sp_password $passAct,$passNuevo,$passlogin";
		$result=@sybase_query($query,$sybuser_connection);
		//echo $query;
		
		if(empty($result)){
			echo "<h1>Error al modificar el password de <i>$passlogin</i></h1>";
		}else{
			$data=sybase_fetch_row($result);
			if($data[0]==0){				
				echo "<h1>El password fue modificado exitosamente para <i>$passlogin</i></h1>";		
			}else{
				echo "<h1>Error al modificar el password de <i>$passlogin</i></h1>";
			}
		}
		
		sybase_close($sybuser_connection);
	}
//}//if($cambio_bd_exitoso)

//Cerrando conexiones a la base de datos

?>	
<input type="button" value="Aceptar" onclick="window.close();">	
</div>
</body>
</html>


